import requests from "./requests"

export const reqServicePag = (data) => {
    return requests({
        url: '/service/getServicePag',
        method: 'get',
        params: data
    })
}

export const reqLogin = (data) => {
    return requests({
        url: '/auth/user/login',
        method: 'post',
        data: data
    })
}

export const reqServiceInfo = (data) => {
    return requests({
        url: '/service/gerServiceInfo',
        method: 'get',
        params: data
    })
}

export const reqUserInfo = () => {
    return requests({
        url: '/user/user/getUserInfo',
        method: 'get',
    })
}

export const reqUpdateUserInfo = (data) => {
    return requests({
        url: '/user/user/updateUserInfo',
        method: 'put',
        data: data
    })
}

export const reqUserAddress = () => {
    return requests({
        url: '/address/getUserAddressList',
        method: 'get',
    })
}

export const reqSaveAddress = (data) => {
    return requests({
        url: '/address/saveUserAddress',
        method: 'post',
        data: data
    })
}

export const reqUpdateAddress = (data) => {
    return requests({
        url: '/address/updateAddress',
        method: 'put',
        data: data
    })
}

export const reqDefaultAddress = () => {
    return requests({
        url: '/address/getDefaultAddress',
        method: 'get',
    })
}

export const reqSaveOrderInfo = (data) => {
    return requests({
        url: '/order/saveOrderInfo',
        method: 'post',
        data: data
    })
}

export const reqOrderList = (data) => {
    return requests({
        url: '/order/getUserOrderList',
        method: 'get',
        params: data
    })
}

export const reqOrderInfo = (data) => {
    return requests({
        url: '/order/getOrderInfo',
        method: 'get',
        params: data
    })
}

export const reqPayOrder = (data) => {
    return requests({
        url: `/alipay/pay/${data}`,
        method: 'get',
    })
}

export const reqCancelOrder = (data) => {
    return requests({
        url: `/order/cancelOrder/${data}`,
        method: 'put',
    })
}

export const reqChangeDefaultAddress = (data) => {
    return requests({
        url: `/address/changeDefaultAddress/${data}`,
        method: 'put',
    })
}

export const reqUpdateUserAvatar = (data) => {
    return requests({
        url: "/user/user/uploadUserAvatar",
        method: 'post',
        data: data
    })
}

export const reqDealInfo = () => {
    return requests({
        url: "/deal/user/getUserDeal",
        method: 'get',
    })
}

export const reqChatList = () => {
    return requests({
        url: "/message/getChatList",
        method: 'get',
    })
}